<style>
body{
	overflow-x:hidden;
}
</style>
	<div class="ui-portlet">
			<ol class="breadcrumb">
			  <li><a href="/users/index"><i class="fa fa-home"></i>&nbsp;&nbsp;{{__('Personal Center')}}</a></li>
			  <li class="active"><a href="/customers/mine">客户管理</a></li>
			</ol>
		</div>           
       <hr>
       <?php $customer_id = $Customer['Customer']['id'];?>
 		<div>
       		<!-- <a class="btn btn-primary" href="/customer_tracks/add?customer_id={{$customer_id}}">新增联系记录</a> -->
       		<!-- <a class="btn btn-primary" href="/customer_opportunities/add?customer_id={{$customer_id}}">新增商机</a> -->
       </div>

	<div class="clearfix">
		<a class="btn btn-primary pull-right" href="/customers/edit/{{$customer_id}}">编辑客户信息</a>
		<h2 style="border-bottom:1px solid #ddd;">{{$Customer['Customer']['name']}} <small>&lt;{{$Customer['Customer']['cate_id']}} {{if $Customer['Customer']['website']}},{{$Customer['Customer']['website']}} {{/if}}&gt;</small></h2>
		<p>地址：{{$Customer['Customer']['address']}}</p>
		<p>{{$Customer['Customer']['grade']}}</p>
		<p>手机：{{$Customer['Customer']['mobile_phone']}} &nbsp;&nbsp; 电话：{{$Customer['Customer']['telephone']}} &nbsp;&nbsp; 邮箱：{{$Customer['Customer']['email']}}</p>
	</div>	
	
	<a class="btn btn-primary" href="/contacts/add?customer_id={{$customer_id}}">新增联系人</a>
	<p><br/></p>
	<table class="table">
		<thead><tr><th>编号</th><th>姓名</th><th>电话</th><th>邮箱</th><th>QQ</th><th>微信号</th><th>操作</th></tr></thead>
	<portlet model="Contact" cache="no" portlet="onlycontent" limit="10" showpages="1" list_tpl="inner" info="conditions[customer_id]=$customer_id">
		<tr><td>{{$item['id']}}</td><td>{{$item['name']}}</td><td>{{if $item['mobilephone']}}{{$item['mobilephone']}}{{elseif $item['workphone']}}{{$item['workphone']}}{{elseif $item['homephone']}}{{$item['homephone']}}{{/if}}</td><td>{{$item['email']}}</td><td>{{$item['qq']}}</td><td>{{$item['wechat']}}</td>
		<td><a href="/contacts/edit/{{$item['id']}}"><small>编辑</small></a>&nbsp;
			<a class="btn btn-xs btn-primary" href="/customer_tracks/add?customer_id={{$customer_id}}&contact_id={{$item['id']}}&referer=/customers/view/{{$customer_id}}"><small>新增联系记录</small></a>
		</td></tr>
	</portlet>
	</table>
	
	<p><br/></p>
	<table class="table">
		<thead><tr><th>联系人编号</th><th>联系内容记录</th><th>联系时间</th><th>操作</th></tr></thead>
	<portlet model="CustomerTrack" cache="no" portlet="onlycontent" limit="10" showpages="1" order="id desc" list_tpl="inner" info="conditions[customer_id]=$customer_id">
		<tr><td>{{$item['contact_id']}}</td><td>{{nl2br($item['name'])}}</td><td>{{$item['created']}}</td>
		<td>
			<a href="/customer_tracks/edit/{{$item['id']}}?customer_id={{$customer_id}}&contact_id={{$item['id']}}&referer=/customers/view/{{$customer_id}}">编辑</a>
		</td></tr>
	</portlet>
	</table>
	<hr>
	<div>{{$Customer['Customer']['description']}}</div>